<?php

namespace App\Http\Controllers\back;

use App\Model\book;
use App\Model\chapter;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;

class TxtController extends Controller
{
    //
    public function show($id)
    {
        $List = chapter::where('bid',$id)->paginate(6);
        return view('back.writeruser.book_txt',compact('List'));
    }
    public function del($id)
    {
        $del = chapter::find($id);
        $del->delete();
        return back();
    }
    public function orderby($id){
//        dd($id);
        $List=DB::table('chapters')->where('bid',$id)->orderby('addtime','asc')->get();
        return view('back.writeruser.book_txt',compact('List'));
    }
}
